package cn.liontalk.producter;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author: 周哲
 * @package: cn.liontalk.producter
 * @description:
 * @date: 2019/1/10 19:33
 * @version: V1.0
 */
@Component
public class ProductSender {


    @Autowired
    private AmqpTemplate template;

    @Value("${mq.config.exchange}")
    private String exchange;


    public void send(String message){
        template.convertAndSend(exchange,"product.log.debug",message);
        template.convertAndSend(exchange,"product.log.info",message);
        template.convertAndSend(exchange,"product.log.error",message);
        template.convertAndSend(exchange,"product.log.warn",message);
    }

}
